import { Component, director, RenderPipeline, ToggleComponent, _decorator } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Main')
export class Main extends Component {
    @property({ type: RenderPipeline })
    private pipelines: RenderPipeline[] = [];

    private onToggleClicked(toggle: ToggleComponent) {
        director.root?.setRenderPipeline(toggle.isChecked ? this.pipelines[1] : this.pipelines[0]);
    }
}
